age = int(input("请输入用户年龄："))

if age>=18:
    print("已成年")
else:
    print("未成年")

#定义变量（true是公司员工）
employer = False
if not (employer is False):
    print("公司员工")
else:
    print("不是公司员工")

# 定义分数变量
score = int(input("请输入分数："))
# 判断分数
if score >= 90:
    print("优")
elif 80 <= score < 90:
    print("良")
elif 70 <= score < 80:
    print("中")
elif 60 <= score < 70:
    print("差")
# 上述条件都不满足时执行else
else:
    print("不及格")

#定义计数器
num=1
#设置循环条件
while num<=10:
    print("我没错！")
    num+=1

#定义计数器
num=1
#定义初始结果变量
result = 0
#设置while循环条件
while num<=100:
    result = result+num
    num+=1
print(f"求和的结果为：{result}")

num=1
while num<=5:
    print(f"吃了第{num}个苹果")
    if num == 3:
        print("吃饱了，后面的不吃了")
        break
    num +=1


info = "itheima"

for i in info:
    if i == "e":
        break

    print(i)

result = 0
for i in range(0,101,2):
    result+=i
print(result)
#导入随机数包
import random
#定义角色变量
player = int(input("请输入出拳的数字（1/2/3）:"))
computer = random.randint(1,3)
#出拳判定，判断player和computer是否一致
if(player==1 and computer == 2)or(player==2 and computer==3)or(player== 3 and computer==1):
    print("电脑输了")
elif player==computer:
    print("打平了，咱俩心有灵犀")
else:
    print("电脑赢了")

#设置循环条件
while True:
    username = input("请输入用户名：")
    # 判断是否是exit
    if username == "exit":
        break
    password = input("请输入密码：")
    # 判断账号密码
    if username=="admin" and password=="123456":
        print("登录成功！")
        break
    else:
        print("用户名密码错误！")

